{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9a8898c4",
   "metadata": {},
   "source": [
    "# 语音识别\n",
    "---\n",
    "### 知识概念\n",
    ">1. 一切都是I/O：软工到产品的一般化知识\n",
    ">2. 语音识别:speech recognition\n",
    ">3. 语音唤醒\n",
    ">4. 自动语音识别:Automatic Speech Recognition, 简称 ASR\n",
    ">>1. 其目标是以电脑自动将人类的语音内容转换为相应的文字。与说话人识别及说话人确认不同，后者尝试识别或确认发出语音的说话人而非其中所包含的词汇内容。\n",
    ">1. 语音合成:text to speech，简称 TTS\n",
    ">>1. 将文字转化为语音的一种技术，类似于人类的嘴巴，通过不同的音色说出想表达的内容。 在语音合成技术中，主要分为 语言分析部分 和 声学系统部分 ，也称为 前端部分 和 后端部分， 语言分析部分主要是根据输入的文字信息进行分析，生成对应的语言学规格书，想好该怎么读；声学系统部分主要是根据语音分析部分提供的语音学规格书，生成对应的音频，实现发声的功能。\n",
    "\n",
    "### 课堂视频资源\n",
    "- [一分钟看懂语音识别](https://www.bilibili.com/video/BV1Lx41177sY/?spm_id_from=333.999.0.0)\n",
    "- [语音识别、语音合成都被用在哪儿？](https://www.bilibili.com/video/BV1jt411p72z/?spm_id_from=333.999.0.0)\n",
    "- [杭州阿里巴巴高科技无人酒店，入住全程靠脸！](https://www.bilibili.com/video/BV1Sb411y7hj/?spm_id_from=333.337.search-card.all.click)\n",
    "- [语音助手敢和真人打电话！\n",
    "- [「ZEALER 特别企划 」语音识别](https://www.bilibili.com/video/BV1vs411k7g8/?spm_id_from=333.999.0.0)\n",
    "- [苹果 小米 华为 天猫 百度，入门款对比测试，谁的表现更胜一筹？](https://www.bilibili.com/video/BV1m64y1t7Lf/?spm_id_from=333.337.search-card.all.click)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e166a9b8",
   "metadata": {},
   "source": [
    "### 语言对话助手机器人\n",
    "> 1.语音识别ASR（将声音转化为文本） \n",
    ">> 1.1百度语音识别API  \n",
    "\n",
    "\n",
    "> 2.自然语言处理（理解文本-->文本生成）  \n",
    ">> 2.1自己构造字典，自定义回复信息  \n",
    "qa = {\n",
    "    \"你好\":\"你好呀，有什么事么？\",\n",
    "    \"你叫什么名字\":\"我是人见人爱，花见花开的小小度呀\",\n",
    "    \"你多大了\":\"这是很私密的问题，我今年18岁了。\",\n",
    "    \"苹果用英文怎么说\":\"apple\",\n",
    "    \"今天天气\":\"我这边墨迹天气显示，今天广州30度，晴\"\n",
    "}  \n",
    ">> 2.2 可以尝试接入有功能的自动回复机器人的API（图灵机器人API）  \n",
    ">> 2.3 可以尝试接入更加智能的语言生成模型（chatgpt、API、文心一言API等）\n",
    "\n",
    "> 3.语音合成TTS（将文本合成语音）  \n",
    ">> 3.1 在步骤2中生成的文本转换成语音（百度语音合成API）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ad3c2df",
   "metadata": {},
   "source": [
    "### 文本自动回复(自定义)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "7d9d4178",
   "metadata": {},
   "outputs": [],
   "source": [
    "qa = {\n",
    "    \"你好\":\"你好呀，有什么事么？\",\n",
    "    \"你叫什么名字\":\"我是人见人爱，花见花开的小小度呀\",\n",
    "    \"你多大了\":\"这是很私密的问题，我今年18岁了。\",\n",
    "    \"苹果用英文怎么说\":\"apple\",\n",
    "    \"今天天气\":\"我这边墨迹天气显示，今天广州30度，晴\",\n",
    "    \"黄芯悦\":\"黄芯悦是负心汉\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "a24c4836",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'你好呀，有什么事么？'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qa.get('你好')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "b3e22d86",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'我是人见人爱，花见花开的小小度呀'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qa.get('你叫什么名字')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "85418654",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'这是很私密的问题，我今年18岁了。'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qa.get('你多大了')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "1d4397ec",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'黄芯悦是负心汉'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qa.get('黄芯悦')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6249a4b2",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
